/*    file: RtmpWriter.h
 *    desc:
 *   
 * created: 2017-01-04
 *  author: chuanjiang.zh@qq.com
 * company: 
 */ 


#if !defined RTMPWRITER_H_
#define RTMPWRITER_H_

#include "MediaFormat.h"
#include "MediaPacket.h"
#include <string>
#include "Ffmpeg.h"


namespace av
{

class RtmpWriter
{
public:
	RtmpWriter();
	~RtmpWriter();

	bool open(const std::string& url, MediaFormat& fmt);
	void close();
	bool isOpen();

	bool write(AVPacket& pkt);

protected:
	AVFormatContext*	m_fmtCtx;
	int	m_videoIndex;
	int	m_audioIndex;
	std::string	m_filename;
	MediaFormat	m_format;

};


}


#endif //RTMPWRITER_H_

